import {NgModule} from '@angular/core';
import {RouterModule,Routes} from '@angular/router';
import {HomeComponent} from './home/home.component'
import {HelloComponent} from './hello/hello.component'
import {ListComponent } from './list/list.component';

const routers: Routes = [
    {
        path:'',
        component:HomeComponent
    },
    {
        path:'home',
        component:HomeComponent,
        children:[
            {
                path:'list',
                component:ListComponent
            }
        ]
    },
    {
        path:'hello/:id',
        component:HelloComponent,
 
    },
    {
        path:'**',
        component:HomeComponent
    },
];

@NgModule({
    imports:[RouterModule.forRoot(routers)],
    exports:[RouterModule]
})

export class AppRoutingModule { }